package shin.bigenner;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AbsoluteLayout;
import android.widget.Button;
import android.widget.LinearLayout;

public class DrawTest1 extends Activity {
    
	private TBox box;
	
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        box = new TBox(this);
        
        ((AbsoluteLayout) findViewById(R.id.AbsoluteLayout01)).addView(box);
        
        ((Button) findViewById(R.id.Button01)).setOnClickListener(on_Left);
        ((Button) findViewById(R.id.Button02)).setOnClickListener(on_Right);
        ((Button) findViewById(R.id.Button03)).setOnClickListener(on_Up);
        ((Button) findViewById(R.id.Button04)).setOnClickListener(on_Down);
        
    }
    
    
    private View.OnClickListener on_Left = new View.OnClickListener() {
		
		@Override
		public void onClick(View v) {
			box.MoveLeft(5);
		}
	};
	
	private View.OnClickListener on_Right = new View.OnClickListener() {
		
		@Override
		public void onClick(View v) {
			box.MoveRight(5);
		}
	};
	
	private View.OnClickListener on_Up = new View.OnClickListener() {
		
		@Override
		public void onClick(View v) {
			box.MoveUp(5);
		}
	};
	
	private View.OnClickListener on_Down = new View.OnClickListener() {
		
		@Override
		public void onClick(View v) {
			box.MoveDown(5);
		}
	};
}